package com.lagou.task03;

/**
 *
 * 手机卡：
 * 特征：卡类型、卡号、用户名、密码、账户余额、通话时长(分钟)、上网流量
 * 行为：显示（卡号 + 用户名 + 当前余额）
 *
 * */
public class SIMCard {

    //卡类型
    private SIMCardTypeEnum cardType;
    //卡号
    private String cardNo;
    //用户名
    private String cardUserName;
    //密码
    private String cardUserPassword;
    //账户余额
    private double cardAccount;
    //通话时长
    private int cardCallMinute;
    //上网流量
    private double internetFlowG;

    public SIMCardTypeEnum getCardType() {
        return cardType;
    }

    public void setCardType(SIMCardTypeEnum cardType) {
        this.cardType = cardType;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getCardUserName() {
        return cardUserName;
    }

    public void setCardUserName(String cardUserName) {
        this.cardUserName = cardUserName;
    }

    public String getCardUserPassword() {
        return cardUserPassword;
    }

    public void setCardUserPassword(String cardUserPassword) {
        this.cardUserPassword = cardUserPassword;
    }

    public double getCardAccount() {
        return cardAccount;
    }

    public void setCardAccount(double cardAccount) {
        this.cardAccount = cardAccount;
    }

    public int getCardCallMinute() {
        return cardCallMinute;
    }

    //设置剩余通话分钟
    public void setCardCallMinute(int cardCallMinute) {
        //可以为负数，表示用掉了通话时长
        this.cardCallMinute += cardCallMinute;
    }

    public double getInternetFlowG() {
        return internetFlowG;
    }

    //设置剩余流量
    public void setInternetFlowG(double internetFlowG) {
        //流量可以为负数，表示消耗了流量
        this.internetFlowG += internetFlowG;

    }

    //充值
    public void recharge(double amt){
        cardAccount += amt;
    }

    //消费
    public void consumption(double amt){
        cardAccount -= amt;
    }



    public void show(){
        System.out.println("当前SIM信息\n卡号：" + cardNo + "\t用户名：" + cardUserName + "\t当前余额：" + cardAccount);
        System.out.println();
    }

}
